-- Viral Resistance - T-Engine 4 Module
-- Copyright (C) 2010 Mikolai Fajer
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation, either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program.  If not, see <http://www.gnu.org/licenses/>.
--
-- Mikolai Fajer "yufra"
-- mfajer@gmail.com

newChat{ id="first",
	text = [[#LIGHT_GREEN#The noises die down as you draw close.]],
	answers = {
		{[[#LIGHT_BLUE#Knock on the door.]],
			jump = "nothing",
		},
		{[["Dr. Tennum, is that you?"]],
			jump = "greeting",
			cond=function(npc, player)
				return player:isQuestStatus("headquarters", engine.Quest.PENDING, "find tennum")
			end,
			action=function(npc, player)
				player:setQuestStatus()
			end,
		},
		{"#LIGHT_BLUE#Walk away."},
	}
}

newChat{ id="nothing",
	text = [[#LIGHT_GREEN#There is only silence behind the door.]],
	answers = {
		{[[#LIGHT_BLUE#Knock on the door.]],
			jump = "nothing",
		},
		{[["Dr. Tennum, is that you?"]],
			jump = "greeting",
			cond=function(npc, player)
				return player:isQuestStatus("headquarters", engine.Quest.PENDING, "find tennum")
			end,
			action=function(npc, player)
				player:setQuestStatus("headquarters", engine.Quest.COMPLETED, "find tennum")
			end,
		},
		{([["Dr. Tennum it is me, %s]]):format(game.player.name),
			jump = "sample",
			cond = function(npc, player)
				return player:isQuestStatus("headquarters", engine.Quest.COMPLETED, "find tennum")
			end
		},
		{"#LIGHT_BLUE#Walk away."},
	}
}

newChat{ id="greeting",
	text = [[#LIGHT_GREEN#A squeak of surprise sounds on the other side of the door.  #WHITE#"Who is out there, and how do you know my name?"]],
	answers = {
		{([["I am Corporal %s, General Edwards sent me to find you.  I need your help analyzing a blood sample."]]):format(game.player.name),
			jump = "sample",
		},
	}
}

newChat{ id = "sample",
	text = [["Do you have the sample?  I am not leaving until I absolutely have to."]],
	answers = {
		{[["No, I don't have the sample yet."]],
			jump = "refusal",
			cond=function(npc, player)
				return player:isQuestStatus("headquarters", engine.Quest.PENDING, "collect sample")
			end,
		},
		{[["I have the sample right here."]],
			jump = "coming out",
			cond = function(npc, player)
				return player:isQuestStatus("headquarters", engine.Quest.COMPLETE, "collect sample")
			end,
		},
	}
}

newChat{ id = "refusal",
	text = [["I am not opening this door until I have to!  If you bring me the sample I'll come out, but not a minute sooner.  And bring me a gun, too."]],
	answers = {
		{"#LIGHT_BLUE#Walk away."},
	},
}

newChat{ id = "coming out",
	text = [[NOT SUPPORTED YET.]],
	answers = {
		{"NOT SUPPORTED YET."},
	},
}

return "first"